<html>
<head><meta charset="utf-8"><title>layout_of after typeck · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html">layout_of after typeck</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238266870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/layout_of%20after%20typeck/near/238266870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html#238266870">(May 11 2021 at 08:01)</a>:</h4>
<p>I'm trying to profile the affect of RFC 2229 on closure size. During the closure capture analysis stage, I store within typeck results the ty::Closure before and after the feature.</p>
<p>During the typeck writeback stage I resolve any inference variables in the types i had stored and call layout_of to compute the size of the closure and output them to stdout.</p>
<p>I run into a cyclic error: <a href="http://csclub.uwaterloo.ca/~a52arora/compiler_size">http://csclub.uwaterloo.ca/~a52arora/compiler_size</a></p>
<p>Code for my change is here: <a href="https://github.com/rust-lang/rust/compare/master...sexxi-goose:closure_size?expand=1">https://github.com/rust-lang/rust/compare/master...sexxi-goose:closure_size?expand=1</a></p>



<a name="238266969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/layout_of%20after%20typeck/near/238266969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html#238266969">(May 11 2021 at 08:02)</a>:</h4>
<p>I'm not sure what's the best place to be calling layout_of, to avoid the cyclic error</p>



<a name="238350779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/layout_of%20after%20typeck/near/238350779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html#238350779">(May 11 2021 at 17:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="238354369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/layout_of%20after%20typeck/near/238354369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html#238354369">(May 11 2021 at 17:50)</a>:</h4>
<p>if you just want a quick hack for now, you could do it in <code>mir_built</code> which should get called for all bodies as we need it to borrowck</p>



<a name="238355460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/layout_of%20after%20typeck/near/238355460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/layout_of.20after.20typeck.html#238355460">(May 11 2021 at 17:57)</a>:</h4>
<p>I'll poke around there, thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>